/* ************************************************************************



************************************************************************ */

qx.Class.define("HersPOS.LeftComp",
{
  extend : qx.ui.container.Composite,

  events :
  {
    "changeParam" : "qx.event.type.Data",
    "changedSel"  : "qx.event.type.Data"
  },

  construct : function()
  {
    this.base(arguments);
    this.setLayout(new qx.ui.layout.Grow());
    this.setDecorator("main");
    this.setWidth(Math.floor(qx.bom.Viewport.getWidth() / 8));

    //   this.setPadding(0,0,0,0)
    //     var cases = [];
    this.folderTree = new qx.ui.tree.VirtualTree(null, "name", "children");
    ftree = this.folderTree;

    //     this.folderTree = new qx.ui.tree.VirtualTree();
    var url = "http://localhost:8000/HersPOS/default/list_data.json";

    //     var date_list_service = new HersPOS.DateListData()
    //     var list_controller = new qx.data.controller.Tree(null,this.folderTree,"children","name")
    //     date_list_service.bind("list_items",list_controller,"model")
    that=this
    this.folderTree.getSelection().addListener("change", function(e)
    {
      param = ftree.getSelection().getItem(0).getName();
      that.fireDataEvent("changeParam", param);
    });

    this.add(this.folderTree);

  }
});

//     this.data= new qx.data.store.Json(url)
//     this.data.bind("model",this.folderTree,"model")
//
// //     date_list_service.fetch_dates()
//     this.data.addListener("loaded", function(e) {
//        console.log("Got Changedata");
//        console.log(e.getData());
//       this.folderTree.openNode(this.folderTree.getModel().getChildren().getItem(0));
//     }, this);
//     this.Height("20%")
//     this.setHeight(Math.floor(qx.bom.Viewport.getHeight()));
//     this.setAppearance("app-header");
//     this.setBackgroundColor("background-splitpane")
//     this.setWidth(Math.floor(qx.bom.Viewport.getWidth() * 0.12));
//     this.vpane = new qx.ui.splitpane.Pane('vertical')
//     this.add(this.vpane)